home *** CD-ROM | disk | FTP | other *** search
/ PC Guide Interactive 5 / PC Guide Issue 5 (Future Publishing) (1995).iso / win95 / shared.dir / 00378_MAIN SCRIPTS.ls < prev    next >
Encoding:
Text File  |  1995-06-01  |  12.9 KB  |  575 lines

  1. on InitializeDemo
  2.   global gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gMainMovieName, gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gTeaserList, gCurrTeaser, gDialogResult, gAutoTestMode, gScanExitFlag, gNoHelp, gTopicList, gCurrTopic, gLastForwardBlink, gLastTextBox, gLastScreen, gCDROMversion, gLastAudio, gAudioPath, gSectionAnimationSpeed, gNextKey, gBackKey, gMenuKey, gRestartKey, gExitKey, glasttms
  3.   clearGlobals()
  4.   set glasttms to the timeoutScript
  5.   setUpDemo()
  6.   set gAutoTestMode to 0
  7.   set gAutoMode to 0
  8.   set gTeaserMode to 0
  9.   set gMainMovieName to "A95Demo.DIR"
  10.   set gScanExitFlag to 1
  11.   set gLastAudio to EMPTY
  12.   set gTopicList to field "file list"
  13.   set gCurrTopic to 1
  14.   set gTeaserList to field "teaser list"
  15.   set gCurrTeaser to 0
  16.   set gLastForwardBlink to the ticks
  17.   set gDialogResult to EMPTY
  18.   set gLastTextBox to EMPTY
  19.   set gLastScreen to EMPTY
  20.   if the machineType = 256 then
  21.     set the exitLock to 1
  22.   end if
  23. end
  24.  
  25. on showtimeout
  26.   global glasttms
  27.   if glasttms <> the timeoutScript then
  28.     put the timeoutScript
  29.     put the timeoutLength
  30.     set glasttms to the timeoutScript
  31.   end if
  32. end
  33.  
  34. on startMovie
  35.   global gMainMovieName, gAutoMode, gResellerVersion, gSwapResExit
  36.   if voidp(gAutoMode) then
  37.     InitializeDemo()
  38.   end if
  39.   if the movie <> gMainMovieName then
  40.     setupTopicMovies()
  41.   end if
  42. end
  43.  
  44. on setupTopicMovies
  45.   global gResellerVersion, gCurrCPButton, gCPbuttonIndex, gDontHilite, gLastAudio, gSwapResExit
  46.   set gDontHilite to 0
  47.   set gLastAudio to EMPTY
  48.   repeat with x = 23 to 28
  49.     puppetSprite(x, 1)
  50.   end repeat
  51.   if gResellerVersion = 1 then
  52.     set EXRSbutton to 28
  53.   else
  54.     set EXRSbutton to 27
  55.   end if
  56.   set gCurrCPButton to 1
  57.   set gCPbuttonIndex to "24" & RETURN & EXRSbutton & RETURN & "23" & RETURN & "25"
  58.   if gSwapResExit = 1 then
  59.     set the locH of sprite EXRSbutton to 555
  60.     puppetSprite(26, 1)
  61.     set the locH of sprite 26 to -1000
  62.   end if
  63.   updateStage()
  64. end
  65.  
  66. on chooseInteractive
  67.   global gAutoMode, gResellerTimeout, gOEMTimeout, gResellerVersion
  68.   set the timeoutScript to EMPTY
  69.   set gAutoMode to 0
  70.   if gResellerVersion = 1 then
  71.     resetResellerTimeout()
  72.   else
  73.   end if
  74.   go("p1")
  75. end
  76.  
  77. on resetResellerTimeout
  78.   global gResellerTimeout
  79.   set the timeoutLength to gResellerTimeout
  80.   set the timeoutScript to "timeOutResellerDialog"
  81. end
  82.  
  83. on clearTimeout
  84.   set the timeoutScript to EMPTY
  85.   set the timeoutLength to 0
  86. end
  87.  
  88. on chooseAutoDemo
  89.   global gAutoMode, gTeaserMode
  90.   set the timeoutScript to EMPTY
  91.   set gAutoMode to 1
  92.   set gTeaserMode to 0
  93.   if (the frame - 1) = label("introDialog") then
  94.     clearMenuButtons()
  95.   end if
  96.   go("p1")
  97. end
  98.  
  99. on startAutoDemo
  100.   set the timeoutScript to EMPTY
  101.   selectSection("full tour")
  102. end
  103.  
  104. on doIntroAnimation
  105.   clearMenuButtons()
  106.   set the timeoutScript to EMPTY
  107.   set the timeoutLength to 0
  108.   go("introAnimation")
  109. end
  110.  
  111. on chooseAutoDemoOLD
  112.   global gAutoMode
  113.   set the timeoutScript to EMPTY
  114.   set gAutoMode to 1
  115.   go("blank")
  116.   selectSection("full tour")
  117. end
  118.  
  119. on chooseTeaserDemo
  120.   global gResellerTimeout, gAutoMode, gTeaserMode, gTeaserList, gCurrTeaser
  121.   set the timeoutScript to EMPTY
  122.   set gAutoMode to 1
  123.   set gTeaserMode to 1
  124.   if (the frame - 1) = label("introDialog") then
  125.     clearMenuButtons()
  126.   end if
  127.   set gCurrTeaser to gCurrTeaser + 1
  128.   if gCurrTeaser > the number of lines in gTeaserList then
  129.     set gCurrTeaser to 1
  130.   end if
  131.   go("p1")
  132. end
  133.  
  134. on startTeaserDemo
  135.   global gAutoMode, gTeaserMode, gTeaserList, gCurrTeaser
  136.   set teaser to line gCurrTeaser of gTeaserList
  137.   selectSection(teaser)
  138. end
  139.  
  140. on setSprites default
  141.   global gCurrDialogButton
  142.   set gCurrDialogButton to default
  143.   puppetSprite(2, 1)
  144.   puppetSprite(3, 1)
  145.   if the castNum of sprite 4 <> 0 then
  146.     puppetSprite(4, 1)
  147.   end if
  148. end
  149.  
  150. on hiliteButton s
  151.   global gDontHilite
  152.   if voidp(s) then
  153.     if gDontHilite = 0 then
  154.       set s to the clickOn
  155.     else
  156.       set gDontHilite to 0
  157.       exit
  158.     end if
  159.   end if
  160.   if the puppet of sprite s = 0 then
  161.     set setPuppet to 1
  162.   else
  163.     set setPuppet to 0
  164.   end if
  165.   set h to the locH of sprite s
  166.   set v to the locV of sprite s
  167.   if setPuppet = 1 then
  168.     puppetSprite(s, 1)
  169.   end if
  170.   set the locH of sprite s to h + 2
  171.   set the locV of sprite s to v + 2
  172.   updateStage()
  173.   wait()
  174.   set the locH of sprite s to h
  175.   set the locV of sprite s to v
  176.   updateStage()
  177.   wait()
  178.   if setPuppet = 1 then
  179.     puppetSprite(s, 0)
  180.   end if
  181. end
  182.  
  183. on menuTransition
  184. end
  185.  
  186. on selectSection section
  187.   global gTopicList, gCurrTopic, gCurrSection, gNoHelp
  188.   hiliteButton()
  189.   set gCurrSection to section
  190.   if (gNoHelp = 1) and ((section = "quick tour") or (section = "customizing")) then
  191.     set gTopicList to field (section & " nohelp")
  192.   else
  193.     set gTopicList to field section
  194.   end if
  195.   set gCurrTopic to 1
  196.   hideChecks()
  197.   clearMenuButtons()
  198.   go(1, line gCurrTopic of gTopicList)
  199. end
  200.  
  201. on goMenu menuNUm
  202.   global gMainMovieName, gCurrSection, gLastScreen, gAutoMode, gResellerVersion
  203.   sound stop 1
  204.   if gAutoMode = 1 then
  205.     AutoDecisionDialog()
  206.     exit
  207.   end if
  208.   if not voidp(menuNUm) then
  209.     hideChecks()
  210.     if (gResellerVersion = 0) and (menuNUm = 1) then
  211.       go("menu1eu", gMainMovieName)
  212.     else
  213.       go("menu" & string(menuNUm))
  214.     end if
  215.     showChecksMenu(menuNUm)
  216.     exit
  217.   end if
  218.   if "dial msn exchange plug system plus office" contains gCurrSection then
  219.     pushLastScreen()
  220.     if the movie = gMainMovieName then
  221.       menuTransition()
  222.       go("menu3")
  223.     else
  224.       menuTransition()
  225.       go("menu3", gMainMovieName)
  226.     end if
  227.     menuTransition()
  228.     showChecksMenu(3)
  229.   else
  230.     pushLastScreen()
  231.     if the movie = gMainMovieName then
  232.       go("menu2")
  233.     else
  234.       go("menu2", gMainMovieName)
  235.     end if
  236.     menuTransition()
  237.     showChecksMenu(2)
  238.   end if
  239. end
  240.  
  241. on backToLastFrame
  242.   global gLastScreen
  243.   hiliteButton()
  244.   clearMenuButtons()
  245.   set m to gLastScreen
  246.   pushLastScreen()
  247.   if m <> EMPTY then
  248.     if item 2 of m = the movie then
  249.       go(value(item 1 of m))
  250.     else
  251.       go(value(item 1 of m), item 2 of m)
  252.     end if
  253.   end if
  254. end
  255.  
  256. on pushLastScreen
  257.   global gLastScreen
  258.   set frameNo to marker(0)
  259.   set m to the movie
  260.   if m = "W95Demo.EXE" then
  261.     set m to "A95DEMO.DIR"
  262.   end if
  263.   set gLastScreen to frameNo & "," & m
  264. end
  265.  
  266. on goBack
  267.   global gTopicList, gCurrTopic, gAutoMode
  268.   sound stop 1
  269.   if gAutoMode = 1 then
  270.     AutoDecisionDialog()
  271.     exit
  272.   end if
  273.   if the frameLabel contains "start" then
  274.     set gCurrTopic to gCurrTopic - 1
  275.     if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
  276.       goMenu()
  277.     else
  278.       set topic to line gCurrTopic of gTopicList
  279.       go("end", topic)
  280.     end if
  281.   else
  282.     if the frameLabel = "endCoffee" then
  283.       go("coffee")
  284.     else
  285.       go(marker(-1))
  286.       if the frameScript = 451 then
  287.         go(marker(-1))
  288.       end if
  289.     end if
  290.   end if
  291. end
  292.  
  293. on goNext
  294.   global gTopicList, gCurrTopic, gCurrSection, mouseUp, gLastScreen, gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gMainMovieName
  295.   sound stop 1
  296.   if gAutoMode = 1 then
  297.     AutoDecisionDialog()
  298.     exit
  299.   end if
  300.   if the frameLabel = "end" then
  301.     addFinishedTopic(line gCurrTopic of gTopicList)
  302.     set gCurrTopic to gCurrTopic + 1
  303.     if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
  304.       if gCurrSection = "quick tour" then
  305.         set gLastScreen to the frame & "," & the movie
  306.         go("m3d", gMainMovieName)
  307.       else
  308.         goMenu()
  309.       end if
  310.     else
  311.       set topic to line gCurrTopic of gTopicList
  312.       go(1, topic)
  313.     end if
  314.   else
  315.     go(marker(1))
  316.   end if
  317. end
  318.  
  319. on addFinishedTopic finishedTopic
  320.   global gFinishedTopics
  321.   if not (gFinishedTopics contains finishedTopic) then
  322.     put finishedTopic & RETURN after gFinishedTopics
  323.   end if
  324. end
  325.  
  326. on clearMenuButtons
  327.   global gCurrDialogButton
  328.   repeat with s = 9 to 19
  329.     puppetSprite(s, 0)
  330.   end repeat
  331.   puppetSprite(20, 0)
  332.   set gCurrDialogButton to 0
  333. end
  334.  
  335. on setMenuExitButton s
  336.   global gResellerVersion
  337.   puppetSprite(20, 1)
  338.   if gResellerVersion = 1 then
  339.     set the castNum of sprite s to cast "green restart"
  340.   end if
  341.   set the locH of sprite 20 to -1000
  342.   updateStage()
  343. end
  344.  
  345. on setDefaultMenuButton sp
  346.   global gCurrDialogButton
  347.   if voidp(gCurrDialogButton) or (gCurrDialogButton = 0) then
  348.     set gCurrDialogButton to 9
  349.     set lastsprite to gCurrDialogButton
  350.     set gCurrDialogButton to sp
  351.     set c to the castNum of sprite lastsprite
  352.     set the castNum of sprite lastsprite to c - 1
  353.     set c to the castNum of sprite gCurrDialogButton
  354.     set the castNum of sprite gCurrDialogButton to c + 1
  355.   end if
  356. end
  357.  
  358. on showChecksMenu menuNUm
  359.   global gFinishedTopics, gCurrSection
  360.   if voidp(gFinishedTopics) then
  361.     set gFinishedTopics to EMPTY
  362.   end if
  363.   set lastChar to the number of chars in gFinishedTopics
  364.   if char lastChar of gFinishedTopics = RETURN then
  365.     delete char lastChar of gFinishedTopics
  366.   end if
  367.   puppetSprite(41, 1)
  368.   puppetSprite(42, 1)
  369.   puppetSprite(43, 1)
  370.   puppetSprite(44, 1)
  371.   puppetSprite(45, 1)
  372.   puppetSprite(46, 1)
  373.   puppetSprite(47, 1)
  374.   if gFinishedTopics = EMPTY then
  375.   end if
  376.   if gCurrSection <> EMPTY then
  377.   end if
  378.   if menuNUm = 2 then
  379.     if gFinishedTopics contains field "getting" then
  380.       showc(41)
  381.     else
  382.       setDefaultMenuButton(9)
  383.     end if
  384.     if gFinishedTopics contains field "working" then
  385.       showc(42)
  386.     else
  387.       setDefaultMenuButton(10)
  388.     end if
  389.     if gFinishedTopics contains field "organizing" then
  390.       showc(43)
  391.     else
  392.       setDefaultMenuButton(11)
  393.     end if
  394.     if gFinishedTopics contains field "customizing" then
  395.       showc(44)
  396.     else
  397.       setDefaultMenuButton(12)
  398.     end if
  399.   else
  400.     if menuNUm = 3 then
  401.       if gFinishedTopics contains field "dial" then
  402.         showc(41)
  403.       else
  404.         setDefaultMenuButton(9)
  405.       end if
  406.       if gFinishedTopics contains field "exchange" then
  407.         showc(42)
  408.       else
  409.         setDefaultMenuButton(10)
  410.       end if
  411.       if gFinishedTopics contains field "MSN" then
  412.         showc(43)
  413.       else
  414.         setDefaultMenuButton(11)
  415.       end if
  416.       if gFinishedTopics contains field "plug" then
  417.         showc(44)
  418.       else
  419.         setDefaultMenuButton(12)
  420.       end if
  421.       if gFinishedTopics contains field "system" then
  422.         showc(45)
  423.       else
  424.         setDefaultMenuButton(13)
  425.       end if
  426.       if gFinishedTopics contains field "plus" then
  427.         showc(46)
  428.       else
  429.         setDefaultMenuButton(14)
  430.       end if
  431.       if gFinishedTopics contains field "office" then
  432.         showc(47)
  433.       else
  434.         setDefaultMenuButton(15)
  435.       end if
  436.     end if
  437.   end if
  438.   updateStage()
  439. end
  440.  
  441. on hideChecks
  442.   puppetSprite(41, 0)
  443.   puppetSprite(42, 0)
  444.   puppetSprite(43, 0)
  445.   puppetSprite(44, 0)
  446.   puppetSprite(45, 0)
  447.   puppetSprite(46, 0)
  448.   puppetSprite(47, 0)
  449.   updateStage()
  450. end
  451.  
  452. on gop2
  453.   go("p2")
  454. end
  455.  
  456. on goCloser
  457.   global gMainMovieName
  458.   dialogClose()
  459.   go("closer", gMainMovieName)
  460. end
  461.  
  462. on goScan
  463.   go("endSniff", field "scan movie name")
  464. end
  465.  
  466. on doEndCloser
  467.   global gAutoMode, gTeaserMode, gResellerVersion, gCDROMversion
  468.   if gResellerVersion = 1 then
  469.     set gAutoMode to 0
  470.     set gTeaserMode to 0
  471.     go("black")
  472.   else
  473.     if (gResellerVersion = 0) and (gCDROMversion = 0) then
  474.       deleteFilesDialog()
  475.     else
  476.       doQuit()
  477.     end if
  478.   end if
  479. end
  480.  
  481. on goRestart
  482.   global gMainMovieName
  483.   dialogClose()
  484.   puppetSprite(24, 0)
  485.   if the movie = gMainMovieName then
  486.     go("intro1")
  487.   else
  488.     go("intro1", gMainMovieName)
  489.   end if
  490. end
  491.  
  492. on doDeleteFiles
  493.   if the machineType = 256 then
  494.     doQuit()
  495.   else
  496.     alert("On Windows Machine, Delete Files Here")
  497.   end if
  498. end
  499.  
  500. on doQuit
  501.   global gMainMovieName
  502.   dialogClose()
  503.   quit()
  504. end
  505.  
  506. on skipIntro
  507.   set the mouseDownScript to EMPTY
  508.   if the key = "s" then
  509.     go("skip")
  510.   end if
  511. end
  512.  
  513. on blinkForwardArrow
  514.   global gLastForwardBlink, gCurrCPButton
  515.   if gCurrCPButton = 1 then
  516.     set default to ".dark"
  517.   else
  518.     set default to EMPTY
  519.   end if
  520.   if (the ticks - gLastForwardBlink) > 25 then
  521.     if the castNum of sprite 24 = the number of cast ("next normal" & default) then
  522.       set num to cast ("next blink" & default)
  523.     else
  524.       if the castNum of sprite 24 = the number of cast ("next blink" & default) then
  525.         set num to cast ("next normal" & default)
  526.       end if
  527.     end if
  528.     set the castNum of sprite 24 to num
  529.     updateStage()
  530.     set gLastForwardBlink to the ticks
  531.   end if
  532. end
  533.  
  534. on showNextBtn
  535.   global gLastForwardBlink, gCurrCPButton
  536.   if gCurrCPButton = 1 then
  537.     set default to ".dark"
  538.   else
  539.     set default to EMPTY
  540.   end if
  541.   if the castNum of sprite 24 <> the number of cast ("next normal" & default) then
  542.     set the castNum of sprite 24 to cast ("next normal" & default)
  543.     updateStage()
  544.   end if
  545. end
  546.  
  547. on show s
  548.   set x to the locH of sprite s
  549.   if x < 0 then
  550.     set the locH of sprite s to x + 1000
  551.   end if
  552. end
  553.  
  554. on hide s
  555.   set x to the locH of sprite s
  556.   if x > 0 then
  557.     set the locH of sprite s to x - 1000
  558.   end if
  559. end
  560.  
  561. on showc s
  562.   set x to the locH of sprite s
  563.   if x < 0 then
  564.     set the locH of sprite s to ((x + 1000) * -1) + 5
  565.   end if
  566. end
  567.  
  568. on hidec s
  569.   set w to the width of sprite s / 2
  570.   set x to the locH of sprite s
  571.   if x > 0 then
  572.     set the locH of sprite s to ((x + 1000) * -1) - w
  573.   end if
  574. end
  575.